<table class="listing">
	<thead>
		<tr>
			{if $listing->multiple_action}
			<th class="th_checkbox"><input class="multiple_action_all" title="check all boxes" type="checkbox" onclick="return checkAllCB($(this).parent().parent().parent().parent(), $(this))"/></th>
			{/if}
			{foreach from=$listing->columnsSettings key='columnSettingsKey' item='columnSettings'}
			{if $columnSettings.displayed}
			<th style="{if isset($columnSettings.hidden) && $columnSettings.hidden}display:none;{/if}{if isset($columnSettings.width_in_percent)}width:{$columnSettings.width_in_percent}%{/if}" class="{if $listing->sortByColumn|wash == $columnSettingsKey|wash}sorted_by_this{/if} JS_ATTR_{$columnSettingsKey|wash}">
				{if $columnSettings.sortable}
				<a href="#" onclick="return sortBy(getListingName($(this)), _getClassAttribute('JS_ATTR_', $(this).parent()));">{$columnSettings.title}</a>
				<a href="#" onclick="return sortBy(getListingName($(this)), _getClassAttribute('JS_ATTR_', $(this).parent()), 'ASC');"><img src="{$fff_uri}/bullet_arrow_up.png" alt=""/></a>
				<a href="#" onclick="return sortBy(getListingName($(this)), _getClassAttribute('JS_ATTR_', $(this).parent()), 'DESC');"><img src="{$fff_uri}/bullet_arrow_down.png" alt=""/></a>
				{else}
				{$columnSettings.title}
				{/if}
				{if $columnSettings.filterable}
				<br/>
				{$columnSettings.type}
				<br/>
				{if $columnSettings.type == 'numeric'}
				<div class="ui-slider-1" style="margin:10px;">
					<div class="ui-slider-handle first"></div>
					<div class="ui-slider-handle" style="left: 200px;"></div>
				</div>
				from <span class="minimum_value">{if $listing->filterColumn == $columnSettingsKey}{$listing->filterValue}{else}{$columnSettings.minimum}{/if}</span> to <span class="maximum_value">{if $listing->filterColumn == $columnSettingsKey}{$listing->filterValue}{else}{$columnSettings.maximum}{/if}</span> <input class="clear_filter" type="button" onclick="return clearThisFilter(getListingName($(this)), $(this).prev());" value="Clear" />
				<script type="text/javascript">
				/*
				$(function(){ldelim}
					addThSlider('{$listing->listing_name}', '{$columnSettingsKey}', parseFloat({$columnSettings.minimum}), parseFloat({$columnSettings.maximum}), {$columnSettings.float_precision});
				{rdelim});
				*/
				//TODO do not insert JS here !! it's ajax loaded !!
				</script>
				{elseif $columnSettings.type == 'date'}
				<input type="text" size="10" value="" class="startDate"/> to <input type="text" size="10" value="" class="endDate"/><input type="button" value="filter this period !">
				(TODO)
				<script type="text/javascript">
				$(function(){ldelim}
					//addThPeriodDatePicker('{$listing->listing_name}', '{$columnSettingsKey}');TODO do not insert JS here !! it's ajax loaded !!
				{rdelim});
				</script>
				{else}
				<input class="filter_value" type="text" value="{if $listing->filterColumn != $columnSettingsKey}Filter...{else}{$listing->filterValue}{/if}" onfocus="if (this.value == 'Filter...') this.value = '';" onblur="if (this.value == '') this.value = 'Filter...';"/><br />
				<input class="clear_filter" type="button" onclick="return clearThisFilter(getListingName($(this)), $(this).prev());" value="Clear" />
				{/if}
				{/if}
			</th>
			{/if}
			{/foreach}
			{if $listing->viewable}
			<th>View</th>
			{/if}
			{if $listing->editable}
			<th>Edit</th>
			{/if}
			{if $listing->removable}
			<th>Remove</th>
			{/if}
		</tr>
	</thead>
	<tbody class="listing_content">
		{foreach from=$listing->data key='tr_index' item='item'}
			{include file='listing_table_item.tpl'}
		{/foreach}
	</tbody>
</table>
{if $listing->data|@count == 0}
<p>No item found.</p>
{/if}
